(function(jq, page) {

    var _doneHandler = function(handler) {

        return function(data) {
            handler(data);
        };
    }
    var _errorHandler = function(handler) {
        return function(data) {
            handler(data);

        }
    }

    page.remote = {
        done: _doneHandler,
        error: _errorHandler
    }
})(jQuery, window.page || (window.page = {}));
(function(jq, page) {

    var getCookie = function(name) {
        var c = document.cookie.match("\\b" + name + "=([^;]*)\\b");
        return c ? c[1] : undefined;
    }
    var _mask = {
        obj: $("<div id='mask'></div>").appendTo("body"),
        show: function() {
            _mask.obj.addClass("mask").width(document.body.scrollWidth).height(document.body.scrollHeight).fadeIn(200);
        },
        hide: function() {
            _mask.obj.fadeOut(200);
        }
    }


    page.utils = {
        cookie: {
            get: getCookie
        },
        mask: {
            show: _mask.show,
            hide: _mask.hide
        }
    }
})(jQuery, window.page || (window.page = {}));
(function(jq, page) {

    var postjson = {
        dataType: 'json',
        type: 'post'
    }
    var getjson = {
        dataType: 'json',
        type: 'get'
    }


    page.args = {
        getjson: getjson,
        postjson: postjson
    }
})(jQuery, window.page || (window.page = {}));
